/*返回顶部*/
$(this).scroll(function () {
    var str = $(window).scrollTop();
    if (str > 400) {
        $("#dingbu").fadeIn();
    } else {
        $("#dingbu").fadeOut();
    }
})
/*返回顶部延迟*/
$("#dingbu a").click(function () {
    $("html,body").animate({scrollTop: 0}, 800);//点击go to top按钮时，以800的速度回到顶部，这里的800可以根据你的需求修改
    return;
});

/*qq回话*/
function onvser() {
    document.getElementById("qqtubiao").src = "/img/qqq.png"
}

function onseout() {
    document.getElementById("qqtubiao").src = "/img/qqq1.png"
}


$(".right-img > img").mouseenter(function(){
    $(".right-img > p").slideDown("slow");
});

$(".right-img > p,.homeheader").mouseleave(function(){
    $(".right-img > p").slideUp("slow");
});


//打赏所有
function switchsrc(switchsrc) {
    if (switchsrc == 1) {
        //打赏切换微信
        document.getElementById("idimgwxzfb").src = "/img/weixinma.png";
    } else if (switchsrc == 2) {
        //打赏切换支付宝
        document.getElementById("idimgwxzfb").src = "/img/zfb.jpg";
    } else if (switchsrc == 5) {
        //打赏切换qq
        document.getElementById("idimgwxzfb").src = "/img/qq.png";
    } else if (switchsrc == 3) {
        //显现打赏
        document.getElementById("div-di").style.display = "block";
    } else if (switchsrc == 4) {
        //关闭打赏
        document.getElementById("div-di").style.display = "none";
    }
}

$(function () {
    let width = $(document.body).width();
    if (width < 700) {
        $("#bodydiv").css("width", '100%');
        $(".tupian").css("height", '200px');
        $("#idzfb, #idwx, #qq").css("margin-left", '0%');
        $("#bodydiv>div>img").css("margin-top", '0px');

    }
})
/*浏览器 宽度变化触发*/
$(window).resize(function () {
    let width = $(document.body).width();
    if (width < 700) {
        $("#bodydiv").css("width", '100%');
        $("#idzfb, #idwx, #qq").css("margin-left", '0%');
        $("#bodydiv>div>img").css("margin-top", '0px');
        $(".tupian").css("height", '200px');
    } else {
        $("#bodydiv").css("width", '75%');
        $("#idzfb, #idwx, #qq").css("margin-left", '3%');
        $(".tupian").css("height", '300px');
    }
})

/*
右键
document.oncontextmenu = function() {
    return false;
}
*/

/*按键监听*/
$("#search").keyup(function () {
    let value = $("#search").val();
    if (event.keyCode == 13) {
        location.href = "/manhua/look/search?value=" + encodeURI(value);
    }
})

/**/
$("#search").click(function () {
    let width = $(document.body).width();
    if (width < 700) {
        location.href = "/manhua/look/search";
    }
})

//百度分享js
window._bd_share_config = {
    "common": {
        "bdSnsKey": {},
        "bdText": "",
        "bdMini": "2",
        "bdMiniList": false,
        "bdPic": "",
        "bdStyle": "0",
        "bdSize": "16"
    },
    "slide": {
        "type": "slide",
        "bdImg": "6",
        "bdPos": "left",
        "bdTop": "100"
    },
    "image": {
        "viewList": ["qzone", "tsina", "tqq", "renren", "weixin"],
        "viewText": "分享到：",
        "viewSize": "16"
    }
};
with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];



